<?php echo $javascript->link('jquery.timelinr-0.9.4.js');?>
<script type="text/javascript">
	$(function(){
		$().timelinr({
			orientation: 'horizontal',
			containerDiv: '#timeline',
			datesDiv: '#dates',
			datesSelectedClass: 'selected',
			datesSpeed: 500,
			issuesDiv : '#issues',
			issuesSelectedClass: 'selected',
			issuesSpeed: 200,
			issuesTransparency: 0.2,
			issuesTransparencySpeed: 500,
			prevButton: '#prev',
			nextButton: '#next',
			arrowKeys: 'false',
			startAt: 1,
			autoPlay: 'false',
			autoPlayDirection: 'forward',
			autoPlayPause: 2000
	 	});
	});
</script>
<?php 
$companyid=$session->read("companyid");
$user=$session->read('User');
$isflag=$action->checkPermissions($user,$companyid);
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $html->link($company["Company"]["company_name"],"/companys/showinfosummary/".$company["Company"]["id"])?></h2>
		<div class="clear"></div>
	</div>
	<?php 
    	if($isflag){
    		echo '<div class="right item_add_btn">';
			echo $html->link(__('添加',true), 'editeconomic');
			echo '</div>';
		}else{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
    ?>
   
    <?php
    $cuser=$session->read('User'); 
	?>
	<div class="clear"></div>
	<div class="right_sidt_head_screen">
		<div class="right display_by_year_btn"><?php echo $html->link('返回',"/companys/economic/",null,null); ?></div>
		<div class="clear"></div>
	</div>	
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
        <div class="time_line_panel" id='time_panel'>
        	<div class="time_line_area" id="timeline">
            	<ul id="dates">
            	 	<?php if($year_time){
            	 		foreach($year_time as $y){
            	 		?>
            	 			<li><a href="#<?php echo $y; ?>"><?php echo $y; ?></a></li>
            	 		<?php
            	 		}
            	 	}
            	 	?>
                </ul>
                <ul id="issues">
                  
                    <?php foreach($year_time as $y){ 
                    ?>
                    <li id="<?php echo $y; ?>">
                        <div class="issue_details">                 	
                        	<div class="right_sidt_screen_by_year">                 	
                        	  <div class="items_list" id='panel'>
						        	<table>
											<tr>
												<th>企业年度</th>
												<th>总收入（元）</th>
												<th>工业总产值（元）</th>
												<th>净利润（元）</th>
												<th><?php __('Action'); ?></th>	
												<th>融资情况</th>			
											</tr>
										<?php 										
												foreach ($timeeconomics[$y] as $comp_economic)
												{
													$id=$comp_economic["CompEconomic"]["id"];
													echo "<tr class='per_list'>";
													$company_year=$comp_economic['CompEconomic']['company_year'];
													echo "<td>".$html->link($company_year,"/companys/showeconomic/".$id,null,null)."</td>";
													echo "<td>".$comp_economic['CompEconomic']['general_income']."</td>";
													echo "<td>".$comp_economic['CompEconomic']['prospect']."</td>";
													echo "<td>".$comp_economic['CompEconomic']['net_profit']."</td>";	
													echo "<td>";
													if($isflag){
														echo $html->link(__('Edit',true),"/companys/editeconomic/".$id);
													 	echo $html->link(__('Delete',true),"/companys/deleconomics/".$id,array("onclick"=>"return doaction(this)"));
													}else{
														echo "<span class='enableaction'>编辑</span>";
														echo "<span class='enableaction'>删除</span>";
													}
													echo "</td>";						
													echo "<td>".$html->link("融资情况","/companys/financ/")."<td>";	
													echo "</tr>";
										        }									       
									    ?>
										</table>
								</div>
                       		 </div>
                       	</div>
                    </li>
                    <?php } ?>
                </ul>
                <div id="issue_panel_arrow"></div>
                <div id="grad_left"></div>
				<div id="grad_right"></div>
                <a href="#" id="next">+</a>
                <a href="#" id="prev">-</a>
            </div>
        </div>
    </div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
